#include<stdio.h>
#include<math.h>

double fun (double e)
{   
     int x =1;
     double n =1.0,t =1.0,pi=0.0;
      while(fabs(t)>=e)
      {
        pi+=t;
        n+=2;
        x=-x;
        t=x/n;
      }
       return pi;   
}
int main ()
{
    double e ;
    scanf("%lf",&e);
    double pi =fun(e);
    pi =4*pi;
    printf("%lf",pi);
     return 0;
}